package com.bdqn.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bdqn.model.CompanyType;
import com.bdqn.service.CompanyTypeService;

@Controller
@RequestMapping("/companyType")
public class CompanyTypeController {

	@Autowired
	private CompanyTypeService companyTypeService;
	
	@RequestMapping("/type")
	@ResponseBody
	public List<CompanyType> listAll(){
		
		List<CompanyType> ct = new ArrayList<>();
		String state = "启用";
		ct = companyTypeService.listAll(state);
		for (CompanyType companyType : ct) {
			System.out.println(companyType.getType());
		}
		
		
		return ct;
		
	}
	
}
